import logging
from flask import Flask, session
from flask import current_app
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager

from info import create_app, db, models

# 获取app应用程序对象
app = create_app("develop")

# 创建Migrate对象 关联app db
Migrate(app, db)

# 创建Manager对象 关联
manager = Manager(app)
# 给manager添加操作命令
manager.add_command('db', MigrateCommand)
if __name__ == '__main__':
    manager.run()
